﻿using furion.blog.Domain.IRepositories;
using furion.blog.Domain.MySQL;
using furion.blog.Domain.Query.Role;
using Furion.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.EntityFramework.Core.Repositories
{
    public class RoleRepository : BaseSqlSugarRepository<Role>, IRoleRepository, ISingleton
    {

        /// <summary>
        /// 通过ID 查找实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<Role> FindById(long id) { 
            return await base.GetByIdAsync(id);
        }


        /// <summary>
        /// 查询所有
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public async Task<List<Role>> All(RoleDetailQuery query) {
            return await base.GetListAsync(query.Exp());
        }
    }
}
